import http from "@/utils/request";

export async function getGroupList(name: string) {
    return await http('/chatroom/list', 'get', { name: name || '' })
}

export async function groupMembers(chatroomId: number) {
    return http('/chatroom/members', 'get', { chatroomId });
}

export async function addMember(id: number, name: string) {
    return http(`/chatroom/join/${id}`, 'get', {
        joinUsername: name
    });
}

export async function createGroup(name: string) {
    return http(`/chatroom/create-group`, 'get', { name });
}